Preferences

HTML mode is highly customizable. You can modify its behavior in several ways. The picture above shows the default setting of the flags and variables you can change. Most of the flags and variables are discussed in other places in this manual, in the context where they are used.

Flags

JavaScriptColoring if set, key words and comments in JavaScript will be colored. The way the HTML tags are colored is also changed, because the old way does not work well together with JavaScript. The default is 0, do not color JavaScript's key words.
browseInForegroundif set, when you send a file to the browser, the browser will be brought to the foreground. If you have lots of screen space and are just validating, uncheck this flag to leave the browser in the background and Alpha in the foreground. The default is 1, bring browser to foreground.
elecLBracewhen set, the left braces, {, will be electric like in C mode. Set this if you are editing JavaScript. The default is 0, { is not electric.
elecRBracewhen set, the right braces, }, will be electric like in C mode. Set this if you are editing JavaScript. The default is 0, } is not electric.
lidtAreContainersIf set, <LI>, <DT> and <DD> have corresponding closing tags. If not set the optional closing tags are skipped. The default is 0, do not insert a closing tag.
inclEventHandlerwhen set, the event handlers (onFocus onSelect etc.) will appear in the attribute dialog. The default is 0, no event handlers in attribute dialog.
pIsContainerIf set, the <P> element has a corresponding closing tag. If not set it does not. The default is 1, it has a closing tag.
promptNoisilyIf you input element attributes from the status bar, Alpha will beep when asking for element attribute information there. The default is 1, do beep. The value of this flag is only used if useBigWindows is not set.
useBigWindowsIf set, element attributes will be asked about in a a dialog box with all attributes, otherwise they will be asked about in the status bar. The default is 1, use dialog boxes.
useLowerCaseIf not set, elements will be like <P>; if 1, like <p>. The default is 0, upper case.
useTabMarksIf not set, will not insert the characters. The default is 1, to insert them.

Variables

prefixString
suffixString
The string to begin a comment,
and the one to end a comment.
Change these if you want to make comments in JavaScript, but do not forget to change them back when you want to make a HTML comment again.
JavaScriptColorThe color of keywords in JavaScript. These are only colored if the flag JavaScriptColoring is set. The default is magenta.
stringColorThe color of everything between quotes. Only used if the flag JavaScriptColoring is set. The default is green.
tagColorThe color of the HTML tags. The default is blue.
wordBreak
wordBreakPreface
wrapBreak
wrapBreakPreface
The first two control which characters build up words,
and the other two control word wrapping.
Read about them in the general manual if you want to change them (should usually not be needed).

Internal variable which you may change

HTMLwordskeywords which you want to be highlighted when editing HTML in Alpha. They are colored with the same color as the HTML elements. If you want the words "cool" and "nifty" to be highlighted, add the following to your preferences file:
lappend HTMLwords cool nifty
htmlColorizing
The first line defines the words, and the second one tells Alpha to color them. The default is {}, i.e. no keywords.

Defining your own key bindings

It is possible to change the key bindings by using the Alpha "bind" command.

Here are some simple bindings, included as samples of what is possible. For example, if you don't use an American keyboard, you maybe want to change the bindings for &lt; &gt; and &amp; to where they actually are on your keyboard. For example, to get it right on my Swedish keyboard I put the following lines in my preferences file.

bind '<'    <o>     {insertText "&lt\;"} HTML
bind '<'    <so>    {insertText "&gt\;"} HTML
bind '6'    <so>    {insertText "&amp\;"} HTML

Read more about how to define your own key bindings in the general manual.